package com.mapaoer.payment.repository;

import com.mapaoer.payment.entity.MembershipType;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface MembershipTypeRepository extends JpaRepository<MembershipType, Long> {
    
    /**
     * 查询所有启用的会员类型
     */
    List<MembershipType> findByEnabledTrue();
    
    /**
     * 根据时长类型查询会员类型
     */
    Optional<MembershipType> findByDuration(MembershipType.MembershipDuration duration);
}